<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddRoleIdIntoAdminUser extends Migration
{
    /**
     * run migrate
     * 运行迁移时运行
     */
    public function up(){
        Schema::table('admin_user', function(Blueprint $table){
            $table->integer('role_id')->after('id')->nullable(true)
                ->unsigned()->default(0)->comment('角色ID');
        });
    }

    /**
     * down migrate
     * 运行回滚时运行
     */
    public function down(){
        Schema::table('admin_user', function(Blueprint $table){
            $table->dropColumn('role_id');
        });
    }
}
